// 登录相关api

import type { LoginResult } from '@/types/member'
import { http } from '@/utils/http/http'

type login = {
  code: string
  encryptedData: string
  iv: string
}
/**
 * 小程序登录，需要企业微信账号
 * @param data 对象三个参数 code,encryptedData,iv
 */
export const postLoginWxMin = (data: login) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin',
    data,
  })
}

/**
 * 模拟登录
 * @param phoneNumber string 手机号
 */
export const mLoginApi = (phoneNumber: string) => {
  return http<LoginResult>({
    method: 'POST',
    url: '/login/wxMin/simple',
    data: {
      phoneNumber,
    },
  })
}
